/*******************************************************
> Copyright (C) 2024 ==IOT== All rights reserved.
> File Name: time.cpp
> Author: IOT
> Website:www.slq.org
> Created Time: 2024年10月18日 星期五 14时29分59秒
***************************************************/

#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>

using namespace std;

typedef unsigned char u8;

class Time {
	u8 hour; // 成员变量默认私有
	u8 min;
	u8 sec;
public:
	void set_time(u8 _hour, u8 _m, u8 _s)
	{
		hour = _hour;
		min = _m;
		sec = _s;
	}
	void output()
	{
		cout << (int)hour << ":" << (int)min << ":" << (int)sec << endl;
	}
};

/*
全局函数，实现两个时间点的差值,输出秒
*/
int time_diff(Time &t1, Time &t2)
{
	t1.getHour();
}

int main(int argc,const char* argv[])
{
	Time t1, t2;
	
	//t.hour = 14;
	t1.update();
	t.set_time(23,59,59);
	cout << "sizeof Time:" << sizeof(Time) << "," << sizeof(t) << endl;
	t.output();
	t2.update();
	
	int sec = t2 - t1;
    return 0;
}
